module two {
	export class BallItem extends BaseComponent {
		public constructor(private config: IStarConfig) {
			super("BallItem");
		}
		public starImg: eui.Image;
		public starName: eui.Label;

		protected created(): void {
			super.created();

			one.callLater(() => {
				if (this.config.isTouch) {
					this.starName.text = this.config.name;
					this.starName.visible = true;

					if (User_getMyJewelryProxy.getInstance().getJewerlyCodeByStar(this.config.id)) {
						this.starImg.source = `star3_3_png`;
					}
					else {
						this.starImg.source = `star3_2_png`;
					}
				}
				else {
					this.starName.visible = false;
					this.starImg.source = `star3_1_png`;
				}
			}, 3);

			if (this.config.isTouch) {
				two.addTap(this, () => {
					one.monitor.emit("onTouchBallMapPage", this.config.id);
				})
			}
			else
			{
				this.touchEnabled = false;
				this.touchChildren = false;
			}

		}
	}

	two.setClassMap("ballItem", "two.BallItem");
}